import pandas as pd
import numpy as np
from tqdm import tqdm
import time



df = pd.DataFrame(columns=["message", "topic_id", "vector"])
# print(df)



data = {
    'message': ['Hello', 'How are you?', 'Nice to meet you.'],
    'topic_id': [1, 2, 3],
    'vector': [[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]]
}

# 创建 DataFrame
df_data = pd.DataFrame(data)

df_concat = pd.concat([df,df])
print(df_concat)

# #切片长度
# sliced_len = 1
# #df长度
# df_len = len(df_concat)
# df_concat = pd.concat([df,df_data])
# #刚好整除，则是多少份就多少份，否则，多出来的放到最后一个切片里
# sliced_num = df_len//sliced_len if df_len%sliced_len==0 else df_len//sliced_len+1
# sliced_num = 1 if sliced_num==0 else sliced_num

# sliced_df = np.array_split(df_concat,sliced_num)
# for index,part in tqdm(enumerate(sliced_df,1),total=len(sliced_df)):
#     print(f"进度：{index}/{sliced_num}开始，数量：{len(part)}")
#     print(part)
#     time.sleep(2)
#     # print(f"进度：{index}/{sliced_num}完成，数量：{len(part)}")